package cn.trda.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import cn.trda.pojo.Contacts;

public interface AsContactsMapper {
    int deleteByPrimaryKey(Long id);
    
    /**
     * 删除指定id的客户的所有联系人
     * @param customId
     * @return
     */
    @Delete(value="DELETE FROM as_contacts WHERE customId=#{value} ")
    int deleteByCustomerId(Long customId);
    
    int insert(Contacts record);

    int insertSelective(Contacts record);

    Contacts selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Contacts record);

    int updateByPrimaryKey(Contacts record);
    
    @Select(value="select * from as_contacts where customid=#{id}")
    List<Contacts> getContactListByCustomerId(Long id);
}